/******************************************************************************
 Copyright (c) 2024 Qualcomm Technologies International, Ltd.
 All Rights Reserved.
 Qualcomm Technologies International, Ltd. Confidential and Proprietary.


 Brief description about utility:
 id3v2 utility parses Media Object Metadata like Album Name, Artist Name,
 Track name from the current track/next track objects.
******************************************************************************/

#ifndef ID3V2_PARSER_LIB_H
#define ID3V2_PARSER_LIB_H

#include "csr_types.h"
#include "csr_bt_profiles.h"

#define ID3V2_FRAME_HEADER_ID_LENGTH 4

typedef uint16 frameId;
#define ID3V2_ALBUM_FRAME_ID          ((0x01))
#define ID3V2_TITLE1_FRAME_ID         ((0x02))
#define ID3V2_TITLE2_FRAME_ID         ((0x03))
#define ID3V2_TITLE3_FRAME_ID         ((0x04))
#define ID3V2_ARTIST_FRAME_ID         ((0x05))
#define ID3V2_ALBUM_ARTIST_FRAME_ID   ((0x06))
#define ID3V2_TRACK_FRAME_ID          ((0x07))


typedef struct CurrentMediaObjIdFrame
{
    frameId mediaframeType;
    uint32  valueLength;
    uint8*  value;
}CurrentMediaObjIdFrame;

/*!
    @brief id3v2 utility for parsing media object metadata such as Album Name, Artist Name,
    Track name.
    API expects object metadata in single pointer.

    @param streamObject     object stream pointer.
    @param streamLength     object stream pointer length.
    @param frametype        frame id for which information is required refer frameId for supported values.

    Note:
    1. streamObject pointer expects complete tag info for media objects parsing.
    2. Existing utility supports parsing of media tags - Album name, Artist name and Track name only.
    3. Higher layer may chose to use this utility for parsing media tags or can write their own parser.
*/
CurrentMediaObjIdFrame *ParseMediaObjectData(const uint8 *streamObject, uint32 streamLength, frameId frameType);

#endif /*ID3V2_PARSER_LIB_H*/
